$(document).ready(function()
{
	$("#checkPhone").click(function(){
		var serach=$("#CandidateMobilePhone").val();
		if(serach=="")
		{
			alert("请输入手机号");
		}
		else
		{
			var param= [{name:"field",value:"Resume.mobilePhone"},{name:"value",value:serach}];
			  flag=true;
			  $.ajax({
				  type: 'POST',
				   url: root_web_path + "/resumes/resumeCheck",
				   async: false,
				   data: param,
				   dataType:"xml",
				   success: function(xml)
				   {
				  		$(xml).find("aaa").each(function(i){
				  			 var id = $(this).text();
				  			 if(id=="no")
				  			 {
				  				 alert("该手机号已存在");
				  				$("#CandidateMobilePhone").val("");
				  			 }
				  			 else
				  			 {
				  				 alert("该手机号可以使用");
				  			 }
				  		});
				   }
				 });
		}
	});
	
	$("#checkEmail").click(function(){
		var serach=$("#CandidateEmail").val();
		if(serach=="")
		{
			alert("请输入邮箱地址");
		}
		else
		{
			var param= [{name:"field",value:"Resume.email"},{name:"value",value:serach}];
			  flag=true;
			  $.ajax({
				  type: 'POST',
				   url: root_web_path + "/resumes/resumeCheck",
				   async: false,
				   data: param,
				   dataType:"xml",
				   success: function(xml)
				   {
				  		$(xml).find("aaa").each(function(i){
				  			 var id = $(this).text();
				  			 if(id=="no")
				  			 {
				  				 alert("该邮箱地址已存在");
				  				$("#CandidateEmail").val("");
				  			 }
				  			 else
				  			 {
				  				 alert("该邮箱地址可以使用");
				  			 }
				  		});
				   }
				 });
		}
	});
});